//
//  MLAMessageCell.m
//  MagicLampApp
//
//  Created by Zheng on 2018/12/19.
//  Copyright © 2018 zheng.magic.lamp.app. All rights reserved.
//

#import "MLAMessageCell.h"
#import "MLAMessageModel.h"

@implementation MLAMessageCell {
    UILabel *titleLbl;
    UILabel *detailLbl;
    UILabel *dateLbl;
}

- (void)setModel:(MLAMessageModel *)model {
    _model = model;
    
    dateLbl.text = _model.ctime;
    detailLbl.text = _model.content;
    titleLbl.text = _model.title;
    
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        titleLbl = [[UILabel alloc] init];
        titleLbl.font = CX_GetNormalFont(16);
        titleLbl.textColor = CX_GetColorTitle();
        [self.contentView addSubview:titleLbl];
        [titleLbl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(19);
            make.left.mas_equalTo(15);
        }];
        
        detailLbl = [[UILabel alloc] init];
        detailLbl.font = CX_GetNormalFont(12);
        detailLbl.textColor = CX_GetColorHex(0x6B7178, 1);
        [self.contentView addSubview:detailLbl];
        [detailLbl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.mas_equalTo(-19);
            make.left.mas_equalTo(15);
            make.right.mas_equalTo(-15);
        }];
        
        dateLbl = [[UILabel alloc] init];
        dateLbl.font = CX_GetNormalFont(10);
        dateLbl.textColor = CX_GetColorHex(0x999999, 1);
        [self.contentView addSubview:dateLbl];
        [dateLbl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self->titleLbl);
            make.right.mas_equalTo(-15);
        }];
        
        /*
         dateLbl.text = @"2018.9.9 12：21";
         detailLbl.text = @"您的广告位已经到期请您续费";
         titleLbl.text = @"到期提示";
         */
    }
    return self;
}


@end
